package com.bwie.Es;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author: zhaijiaqi
 * @Date: 2025/7/1 15:14
 * @Description:
 **/
@Data
@Document(indexName = "es_prod",shards = 1,replicas = 0)
public class EsProd implements Serializable {
    /**
     * 商品ID
     */
    @Field(type = FieldType.Integer)
    @Id
    private Integer prodId;

    /**
     * SPU
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String prodSpu;

    /**
     * 商品类型;0实物商品1虚拟商品2卡密/网盘
     */
    @Field(type = FieldType.Integer)
    private Integer prodKind;

    /**
     * 商品分类
     */
    @Field(type = FieldType.Integer)
    private Integer prodType;

    /**
     * 商品状态
     */
    @Field(type = FieldType.Integer)
    private Integer prodStatus;



    /**
     * 商品名称
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String prodName;

    /**
     * 商品品牌
     */
    @Field(type = FieldType.Integer)
    private Integer brandId;

    /**
     * 商品单位
     */
    @Field(type = FieldType.Integer)
    private Integer unitId;

    /**
     * 商品标签
     */
    @Field(type = FieldType.Integer)
    private Integer tagId;

    /**
     * 供应商
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String appr;

    /**
     * 缩略图
     */
    @Field(type = FieldType.Text,index = false)
    private String prodImage;

    /**
     * 创建人
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String createBy;

    /**
     * 创建时间
     */
    @Field(type = FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    /**
     * 更新人
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String updateBy;

    /**
     * 更新时间
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String kindName;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String typeName;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String tagName;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String unitName;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String brandName;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String prodName1;
}
